package models

import (
	"gorm.io/gorm"
	"time"
)

/**
* @Description:
* @Author: yuweizhu
* @Date: 2020/11/22 9:02 下午
**/
type TRights struct {
	ID           int
	UserId       int64
	RightsId     int
	Value        int64
	ConsumeValue int64
	RemainValue  int64
	CreatedAt    time.Time
	UpdatedAt    time.Time
	StartTime    time.Time
	EndTime      time.Time
}

func (TRights) TableName() string {
	return "t_rights"
}

//添加
func (e *TRights) Insert(tx *gorm.DB) (err error) {
	if err = tx.Table(e.TableName()).Create(&e).Error; err != nil {
		return
	}
	return
}
